home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
program
/
swagd_f.zip
/
EGAVGA.SWG
/
0007_DACCOLOR.PAS.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-05-28
|
765b
|
41 lines
{
Here is some code to try For Text fading on a vga...
by Sean Palmer
}
Const
tableReadIndex = $3C7;
tableWriteIndex = $3C8;
tableDataRegister = $3C9;
Procedure setColor(color, r, g, b : Byte); Assembler;
Asm {set DAC color}
mov dx, tableWriteIndex;
mov al, color;
out dx, al;
inc dx;
mov al, r;
out dx, al;
mov al, g;
out dx, al;
mov al, b;
out dx, al;
end; {Write index now points to next color}
Function getColor(color : Byte) : LongInt; Assembler;
Asm {get DAC color}
mov dx, tableReadIndex;
mov al, color;
out dx, al;
add dx, 2;
cld;
xor bh, bh;
in al, dx;
mov bl, al;
in al, dx;
mov ah, al;
in al, dx;
mov dx, bx;
end; {read index now points to next color}